package com.wh.cloud.feign;

import com.wh.cloud.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 声明一个fegin接口：会自动扫描并注册标记为Feign客户端的接口，使其能够进行远程服务调用
 * 定义Fegin客户端接口
 */
@FeignClient(name = "my-cloud-user")
public interface UserFeignClient {
   @GetMapping("/api/user/findUserById/{userId}")
    User findUserById(@PathVariable("userId") Long userId);
}
